package com.xhis.homenurse.webservice.api;

/**
 * @author panghuan
 * @Description : 创建请求实例
 * create at 18/3/20 下午3:06
 */
public class WSHttpRequest
{
    private static IWsRequestApi mWsRequestApi;
    private static IWsRequestApi mWsRequestApi_Http,getmWsRequestApi_Gson;

//    public static IWsRequestApi getWsRequestApi(){
//        if (mWsRequestApi == null) {
//            synchronized (WSHttpRequest.class) {
//                mWsRequestApi = ApiConfig.getDefault().create(IWsRequestApi.class);
//            }
//        }
//        return mWsRequestApi;
//    }

    public static IWsRequestApi getWsRequestApi_Http(){
        if (mWsRequestApi_Http == null) {
            synchronized (WSHttpRequest.class) {
                mWsRequestApi_Http = ApiConfig.getDefault_Retrofit_Http().create(IWsRequestApi.class);
            }
        }
        return mWsRequestApi_Http;
    }

    public static IWsRequestApi getWsRequestApi_Gson(){
        if (getmWsRequestApi_Gson == null) {
            synchronized (WSHttpRequest.class) {
                getmWsRequestApi_Gson = ApiConfig.getDefault_Retrofit_Gson().create(IWsRequestApi.class);
            }
        }
        return getmWsRequestApi_Gson;
    }


    public static void clearWsHttpRequest(){
        mWsRequestApi = null;
        mWsRequestApi_Http = null;
    }
}
